<%-- 
    Document   : editCorporateCustomer
    Created on : Dec 24, 2013, 8:29:45 PM
    Author     : santosh
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../common/script.jsp" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/title.jsp" %>
        <script type="text/javascript">
            $(function(){
                $('#scheduleEventT1').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT2').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT3').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT4').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT5').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT6').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT7').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT8').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT9').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT10').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT11').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT12').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT13').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT14').datepicker({dateFormat: 'm-d-y'});
                $('#scheduleEventT15').datepicker({dateFormat: 'm-d-y'});
            });
                        
            function postEvents(eId, eDate, eStatus){
                var corporateId=${coCustomerId};
                $.ajax({
                    url:"../ajaxCallForeditCorporate.htm",
                    dataType:"json",
                    data: ({'eventId':eId,
                        'eventDate':eDate,
                        'eventStatus':eStatus,
                        'corporateId':corporateId}),
                    success:function(json){
                        if(json)
                            alert('Event save successfully');
                        else
                            alert('Conflict while save event');
                        location.reload();
                    },
                    error:function(e){
                        alert('Error: Event data does not saved');
                    }
                });
            }
        </script>
    </head>
    <body>
        <div class="in_02">
            <%@include file="../common/message.jsp" %>
            <form:form id="form1" modelAttribute="events" action="editCorporateCustomer.htm" method="POST">
                <div>
                    <h2 style="padding-left: 12px;">Scheduled Events</h2>
                    <table class="data_table" border="1px">
                        <thead>
                            <tr class="header">
                                <td>Event Description</td>
                                <td>Event Date</td>
                                <td>Status</td>
                                <td>&nbsp;</td>
                                <td>Last Modified By</td>
                                <td>Last Modified Date</td>
                            </tr>
                        </thead>
                        <tr><form:hidden path="corporateCustomerEventId"/>
                            <form:hidden path="corporateCustomer.corporateCustomerId"/>
                            <td>${events.event1.eventDescription}<form:hidden path="event1.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT1" name="scheduleEventT1" value="<fmt:formatDate value="${events.scheduleEvent1}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status1" cssClass="userInputMedium">
                                    <%--<form:option value="0">Not yet</form:option>
                                    <form:option value="1">Yes</form:option>
                                    <form:option value="2">ReScheduled</form:option>
                                    <form:option value="3">Delayed</form:option>
                                    <form:option value="4">Declined</form:option>
                                    <form:option value="5">Left Organization</form:option>

                                    <form:option value="6">Called</form:option>
                                    <form:option value="7">Not reachable</form:option>
                                    <form:option value="8">Phone Busy</form:option>
                                    <form:option value="9">Wrong Number</form:option>
                                    <form:option value="10">Number Not Available</form:option>
                                    <form:option value="11">Employee Busy</form:option>
                                    <form:option value="12">Phone Switched Off</form:option>--%>
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>
                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event1.eventId},document.getElementById('scheduleEventT1').value,document.getElementById('status1').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy1.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate1}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event2.eventDescription}<form:hidden path="event2.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT2" name="scheduleEventT2" value="<fmt:formatDate value="${events.scheduleEvent2}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status2" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event2.eventId},document.getElementById('scheduleEventT2').value,document.getElementById('status2').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy2.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate2}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event3.eventDescription}<form:hidden path="event3.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT3" name="scheduleEventT3" value="<fmt:formatDate value="${events.scheduleEvent3}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status3" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>
                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event3.eventId},document.getElementById('scheduleEventT3').value,document.getElementById('status3').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy3.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate3}" pattern="yyyy-MM-dd HH:mm"/></td>                        
                        </tr>
                        <tr>
                            <td>${events.event4.eventDescription}<form:hidden path="event4.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT4" name="scheduleEventT4" value="<fmt:formatDate value="${events.scheduleEvent4}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status4" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>
                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event4.eventId},document.getElementById('scheduleEventT4').value,document.getElementById('status4').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy4.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate4}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event5.eventDescription}<form:hidden path="event5.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT5" name="scheduleEventT5" value="<fmt:formatDate value="${events.scheduleEvent5}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status5" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event5.eventId},document.getElementById('scheduleEventT5').value,document.getElementById('status5').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy5.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate5}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event6.eventDescription}<form:hidden path="event6.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT6" name="scheduleEventT6" value="<fmt:formatDate value="${events.scheduleEvent6}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status6" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event6.eventId},document.getElementById('scheduleEventT6').value,document.getElementById('status6').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy6.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate6}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event7.eventDescription}<form:hidden path="event7.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT7" name="scheduleEventT7" value="<fmt:formatDate value="${events.scheduleEvent7}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status7" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event7.eventId},document.getElementById('scheduleEventT7').value,document.getElementById('status7').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy7.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate7}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event8.eventDescription}<form:hidden path="event8.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT8" name="scheduleEventT8" value="<fmt:formatDate value="${events.scheduleEvent8}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status8" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event8.eventId},document.getElementById('scheduleEventT8').value,document.getElementById('status8').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy8.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate8}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event9.eventDescription}<form:hidden path="event9.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT9" name="scheduleEventT9" value="<fmt:formatDate value="${events.scheduleEvent9}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status9" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event9.eventId},document.getElementById('scheduleEventT9').value,document.getElementById('status9').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy9.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate9}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event10.eventDescription}<form:hidden path="event10.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT10" name="scheduleEventT10" value="<fmt:formatDate value="${events.scheduleEvent10}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status10" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event10.eventId},document.getElementById('scheduleEventT10').value,document.getElementById('status10').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy10.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate10}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event11.eventDescription}<form:hidden path="event11.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT11" name="scheduleEventT11" value="<fmt:formatDate value="${events.scheduleEvent11}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status11" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event11.eventId},document.getElementById('scheduleEventT11').value,document.getElementById('status11').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy11.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate11}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event12.eventDescription}<form:hidden path="event12.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT12" name="scheduleEventT12" value="<fmt:formatDate value="${events.scheduleEvent12}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status12" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event12.eventId},document.getElementById('scheduleEventT12').value,document.getElementById('status12').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy12.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate12}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr><tr>
                            <td>${events.event13.eventDescription}<form:hidden path="event13.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT13" name="scheduleEventT13" value="<fmt:formatDate value="${events.scheduleEvent13}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status13" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event13.eventId},document.getElementById('scheduleEventT13').value,document.getElementById('status13').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy13.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate13}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event14.eventDescription}<form:hidden path="event14.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT14" name="scheduleEventT14" value="<fmt:formatDate value="${events.scheduleEvent14}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status14" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event14.eventId},document.getElementById('scheduleEventT14').value,document.getElementById('status14').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy14.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate14}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                        <tr>
                            <td>${events.event15.eventDescription}<form:hidden path="event15.eventId"/></td>
                            <td style="padding-top: 15px;"><input id="scheduleEventT15" name="scheduleEventT15" value="<fmt:formatDate value="${events.scheduleEvent15}" pattern="MM-dd-yy"/>" class="userInputMedium" style="width: 70px;"/></td>
                            <td><form:select path="status15" cssClass="userInputMedium">
                                    <form:option value="0">Not yet</form:option>
                                    <form:options items="${eventStatusList}" itemLabel="eventStatusDescription" itemValue="eventStatusId"></form:options>                                </form:select></td>
                            <td><a href="#" onclick="postEvents(${events.event15.eventId},document.getElementById('scheduleEventT15').value,document.getElementById('status15').value);">Save</a></td>
                            <td align="center">${events.lastModifiedBy15.username}</td>
                            <td align="center"><fmt:formatDate value="${events.lastModifiedDate15}" pattern="yyyy-MM-dd HH:mm"/></td>
                        </tr>
                    </table>
                    <div style="padding-left: 12px;margin-top: 5px;">
                        <a href="#" onclick="window.close();">Close</a>
                        <%--<sec:authorize ifAnyGranted="ROLE_BF_CORPORATE_EDIT">
                            <div style="padding-left: 40%;margin-top: -15px;"><input type="submit" id="submit" class="userInputFormSubmit" value="Submit"/></div>
                            </sec:authorize>--%>
                    </div>
                </div>
            </form:form>
        </div>
    </body>
</html>
